import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../components/Index.vue'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    redirect: '/login',
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../components/login.vue')
  },

  {
    path: '/index',
    name: 'index',
    component: Index,
    redirect: '/index/menu2',
    children:[
      {
        path:'/index/Main',
        component:() => import('../components/Main.vue')
      },
      {
        path:'/index/menu1-1',
        component:() => import('../components/Main1-echarts.vue')

      },
      {
        path:'/index/menu1-2',
        component:() => import('../components/Main1-table.vue')

      },
      {
        path:'/index/menu2',
        component:() => import('../components/Main2.vue')
      },
      {
        path:'/index/menu3-1',
        component:() => import('../components/Map/M985.vue')
      },
      {
        path:'/index/menu3-2',
        component:() => import('../components/Map/M211.vue')
      },

      {
        path:'/index/menu3-3',
        component:() => import('../components/Map/Mshuang.vue')
      },


    ]
  } , {
    path:'/center',
    component:() => import('../components/CenterView.vue')

  },


]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
